﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="MJobs.aspx.cs" Inherits="RAgency.Manager.MJobs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Список вакансий:
    </h2>
    <asp:SqlDataSource ID="DS" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
        SelectCommand="SELECT * FROM [vacancy]" 
        UpdateCommand="UPDATE vacancy SET [name]=@name, [education]=@education, [speciality]=@speciality, [exp]=@exp, [duty]=@duty, [payment]=@payment, [age]=@age, [skills]=@skills, [info]=@info WHERE [id_v]=@id_v"
        DeleteCommand="DELETE FROM vacancy WHERE [id_v]=@id_v" />
    <asp:GridView ID="inv" runat="server" DataSourceID="DS" AutoGenerateColumns="false"
        DataKeyNames="id_v" Width="300px">
        <Columns>
            <asp:BoundField HeaderText="ID" DataField="id_v" />
            <asp:BoundField HeaderText="Название" DataField="name" />
            <asp:BoundField HeaderText="Образ-е" DataField="education" />
            <asp:BoundField HeaderText="Спец-ть" DataField="speciality" />
            <asp:BoundField HeaderText="Стаж" DataField="exp" />
            <asp:BoundField HeaderText="Занятость" DataField="duty" />
            <asp:BoundField HeaderText="З/П" DataField="payment" />
            <asp:BoundField HeaderText="Возраст" DataField="age" />
            <asp:BoundField HeaderText="Умения" DataField="skills" />
            <asp:BoundField HeaderText="Инфо" DataField="info" />
            <asp:CommandField ShowEditButton="true" ShowDeleteButton="true" />
        </Columns>
    </asp:GridView>
    <table border="0">
        <tr>
            <td>
                Название:
            </td>
            <td>
                <asp:TextBox runat="server" ID="name" ValidationGroup="createprofile" />
                <asp:RequiredFieldValidator ID="NameValid" ControlToValidate="name" Display="Static"
                    ErrorMessage="Заполните поле!" runat="server" ValidationGroup="createprofile" />
            </td>
        </tr>
        <tr>
            <td>
                Образ-е:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="education_d" ValidationGroup="createprofile">
                    <asp:ListItem Selected="True">Выберите из списка:</asp:ListItem>
                    <asp:ListItem>Высшее</asp:ListItem>
                    <asp:ListItem>Ср/специальное</asp:ListItem>
                    <asp:ListItem>Среднее</asp:ListItem>
                    <asp:ListItem>Без обр-я</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="EduValid" runat="server" ControlToValidate="education_d"
                    ErrorMessage="Значение не выбрано!" InitialValue="Выберите из списка:" ValidationGroup="createprofile"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Спец-ть:
            </td>
            <td>
                <asp:TextBox runat="server" ID="speciality" ValidationGroup="createprofile" />
                <asp:RequiredFieldValidator ID="SpecValid" ControlToValidate="speciality" Display="Static"
                    ErrorMessage="Заполните поле!" runat="server" ValidationGroup="createprofile" />
            </td>
        </tr>
        <tr>
            <td>
                Стаж:
            </td>
            <td>
                <asp:TextBox runat="server" ID="exp" ValidationGroup="createprofile" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="exp"
                    Display="Dynamic" ErrorMessage="Только числа!" ValidationExpression="[0-9]*" ValidationGroup="createprofile" />
                <asp:RequiredFieldValidator ID="ExpValid" ControlToValidate="exp" Display="Static"
                    ErrorMessage="Заполните поле!" runat="server" ValidationGroup="createprofile" />
            </td>
        </tr>
        <tr>
            <td>
                Занятость:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="duty_d" ValidationGroup="createprofile">
                    <asp:ListItem Selected="True">Выберите из списка:</asp:ListItem>
                    <asp:ListItem>Полная</asp:ListItem>
                    <asp:ListItem>Неполная</asp:ListItem>
                    <asp:ListItem>На дому</asp:ListItem>
                    <asp:ListItem>Другое</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="DutyValid" runat="server" ControlToValidate="duty_d"
                    ErrorMessage="Значение не выбрано!" InitialValue="Выберите из списка:" ValidationGroup="createprofile"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                З/П:
            </td>
            <td>
                <asp:TextBox runat="server" ID="payment" ValidationGroup="createprofile" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="payment"
                    Display="Dynamic" ErrorMessage="Только числа!" ValidationExpression="[0-9]*" ValidationGroup="createprofile" />
                <asp:RequiredFieldValidator ID="PayValid" ControlToValidate="payment" Display="Static"
                    ErrorMessage="Заполните поле!" runat="server" ValidationGroup="createprofile" />
            </td>
        </tr>
        <tr>
            <td>
                Возраст:
            </td>
            <td>
                <asp:TextBox runat="server" ID="age" ValidationGroup="createprofile" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="age"
                    Display="Dynamic" ErrorMessage="Только числа!" ValidationExpression="[0-9]*" ValidationGroup="createprofile" />
                <asp:RequiredFieldValidator ID="AgeValid" ControlToValidate="age" Display="Static"
                    ErrorMessage="Заполните поле!" runat="server" ValidationGroup="createprofile" />
            </td>
        </tr>
        <tr>
            <td>
                Умения:
            </td>
            <td>
                <asp:TextBox runat="server" ID="skills" ValidationGroup="createprofile" />
                <asp:RequiredFieldValidator ID="SkillsValid" ControlToValidate="skills" Display="Static"
                    ErrorMessage="Заполните поле!" runat="server" ValidationGroup="createprofile" />
            </td>
        </tr>
        <tr>
            <td>
                Инфо:
            </td>
            <td>
                <asp:TextBox runat="server" ID="info" ValidationGroup="createprofile" />
                <asp:RequiredFieldValidator ID="InfoValid" ControlToValidate="info" Display="Static"
                    ErrorMessage="Заполните поле!" runat="server" ValidationGroup="createprofile" />
            </td>
        </tr>
    </table>
    <asp:Button runat="server" ID="AddButton" Text="Добавить" OnClick="AddButton_Click" ValidationGroup="createprofile" />
    &nbsp;
    <asp:Label ID="ErrLabel" Text="" runat="server" />
</asp:Content>
